export enum SimJobStatus {
  Created = 'created',
  AgentAssigned = 'agentAssigned',
  AgentDispatched = 'agentDispatched',
  Running = 'running',
  Succeed = 'succeed',
  Failed = 'failed',
  Interrupt = 'interrupt',
  UNKNOWN = 'unknown'
}

export enum SimJobType {
  Single = 'single',
  Multi = 'multi',
  Sub = 'sub'
}

export enum ParameterType {
  NUMBER = 'number',
  STRING = 'string',
  ARRAY = 'array',
  FILE = 'file'
}

export interface SimulationParameter {
  name: string,
  value: any,
  unit?: string,
  guiPath?: string,
  type?: ParameterType
}

export interface JobContext {
  userId: string;
  appId: string;
  nodeId: string;
  jobId: string,
  debug: boolean;
  notificationCallback?: string
}

export type ModelLocationType = 'local' | 'remote';

export type SimulationModel = {
  type: ModelLocationType,
  file: string,
  entry?: string
};

export interface EnvironmentVariable {
  name: string,
  value: string
}

export interface SimulationSpec {
  runMode: 'native' | 'hpcc',
  model: SimulationModel,
  parameters?: SimulationParameter[],
  environments: EnvironmentVariable[],
  config?: {
    timeout: number,
  },
  result: {
    specifiedLocalPath?: string,
    uploadRawSimResult?: boolean,
    specifiedOutputParams?: unknown[],
  },
  extendedProperties?: {
    [extendedProperties: string]: unknown
  }
}

export interface JobDefinition {
  businessId?: string,
  desc?: string,
  product: string,
  spec: SimulationSpec
}

export type SimulationResult = {
  type: 'literal' | 'fileCollection',
  value: any
};